#include<iostream>
#include<cstring>
using namespace std;
int arr[50];
int n;
int main()
{
	// 1 3 5 7 9 11 13 15 17
	//  3 5 7 9 11 13 15 17 19
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		if (!(n & 1)) {
			cout << "-1" << endl;
			continue;
		}
		memset(arr, 0, sizeof(arr));
		int m = 0;
		while (n != 1) {
			int k1 = (n + 1) / 2;
			int k2 = (n - 1) / 2;
			if (k1 & 1) {
				arr[++m] = 1;
				n = k1;
			}
			else {
				arr[++m] = 2;
				n = k2;
			}
		}
		cout << m << endl;
		for (int i = m; i >= 1; i--) {
			cout << arr[i] << " ";
		}
		cout << endl;
	}
	return 0;
}